package leetcode.code0057;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public abstract class Solution57 implements IDebug {
	public abstract int[][] insert(int[][] intervals, int[] newInterval);

	@Override
	public void debug1() {
		String str = "[[1,3],[6,9]]";
		int[][] intervals = HelpDebug.str2array1(str);
		String str2 = "[2,5]";
		int[] newInterval = HelpDebug.str2array3(str2);
		int[][] r = this.insert(intervals, newInterval);
		String str1 = "[[1,5],[6,9]]";
		int[][] e = HelpDebug.str2array1(str1);
		HelpDebug.compare(e, r);

	}

	@Override
	public void debug2() {
		String str = "[[1,2],[3,5],[6,7],[8,10],[12,16]]";
		int[][] intervals = HelpDebug.str2array1(str);
		String str2 = "[4,8]";
		int[] newInterval = HelpDebug.str2array3(str2);
		int[][] r = this.insert(intervals, newInterval);
		String str1 = "[[1,2],[3,10],[12,16]]";
		int[][] e = HelpDebug.str2array1(str1);
		HelpDebug.compare(e, r);

	}

	@Override
	public void debug3() {
		String str = "[]";
		int[][] intervals = HelpDebug.str2array1(str);
		String str2 = "[5,7]";
		int[] newInterval = HelpDebug.str2array3(str2);
		int[][] r = this.insert(intervals, newInterval);
		String str1 = "[[5,7]]";
		int[][] e = HelpDebug.str2array1(str1);
		HelpDebug.compare(e, r);

	}

	@Override
	public void debug4() {
		String str = "[[1,5]]";
		int[][] intervals = HelpDebug.str2array1(str);
		String str2 = "[2,3]";
		int[] newInterval = HelpDebug.str2array3(str2);
		int[][] r = this.insert(intervals, newInterval);
		String str1 = "[[1,5]]";
		int[][] e = HelpDebug.str2array1(str1);
		HelpDebug.compare(e, r);

	}

	public void debug5() {
		String str = "[[1,5]]";
		int[][] intervals = HelpDebug.str2array1(str);
		String str2 = "[2,7]";
		int[] newInterval = HelpDebug.str2array3(str2);
		int[][] r = this.insert(intervals, newInterval);
		String str1 = "[[1,7]]";
		int[][] e = HelpDebug.str2array1(str1);
		HelpDebug.compare(e, r);
	}

	public void debug6() {
		String str = "[[1,5]]";
		int[][] intervals = HelpDebug.str2array1(str);
		String str2 = "[6,8]";
		int[] newInterval = HelpDebug.str2array3(str2);
		int[][] r = this.insert(intervals, newInterval);
		String str1 = "[[1,5],[6,8]]";
		int[][] e = HelpDebug.str2array1(str1);
		HelpDebug.compare(e, r);
	}

}
